<?php

namespace Project\ScrumBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class UtilisateurType extends AbstractType {

    public function buildForm(FormBuilderInterface $builder, array $options) {
        $builder
                ->add('email')
                ->add('password')
                ->add('adresse')
                ->add('nom')
                ->add('prenom')
                ->add('ref_role', 'entity', array(
                    'class' => 'Project\ScrumBundle\Entity\Role',
                    'property' => 'role',
                    'label' => 'Role : '));
        ;
    }

    public function setDefaultOptions(OptionsResolverInterface $resolver) {
        $resolver->setDefaults(array(
            'data_class' => 'Project\ScrumBundle\Entity\Utilisateur'
        ));
    }

    public function getName() {
        return 'project_scrumbundle_utilisateurtype';
    }

}
